package org.example.course.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.course.common.XmSelect;
import org.example.course.domain.Check;
import org.example.course.domain.Course;
import org.example.course.domain.Graduation;
import org.example.course.dto.CheckModel;
import org.example.course.dto.CourseModel;
import org.example.course.dto.GraduationModel;

import java.util.List;

/**
 * @Classname CourseMapper
 * @Description 课程
 * @Date 2020/5/8 16:24
 * @Created by
 */
@Mapper
public interface CourseMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Course record);

    int insertSelective(Course record);

    Course selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Course record);

    int updateByPrimaryKey(Course record);

    List<Course> findAll(CourseModel courseModel);

    List<Graduation> findGraduation(String id);

    int deleteGraduation(@Param("graduationId") Integer graduationId, @Param("courseId") Integer courseId);

    Course findByName(@Param("name") String name);


    List<Integer> findGraduationId(String id);

    List<XmSelect> graduationSelect(@Param("ids") List<Integer> ids);


    int addSelectArr(@Param("ids") Integer[] ids, @Param("courseId") Integer courseId);

    List<GraduationModel> findDetails(@Param("id") String id);

    List<Check> findCheck(@Param("id") Integer id);

    List<CheckModel> findDetailsCheck(Integer id);

    int insertCourseGraduation(@Param("courseId") Integer courseId, @Param("graduationId") Integer graduationId);

    List<Graduation> graduation(@Param("ids") List<Integer> ids);
}